#include <iostream>
#include <string>
#include <unistd.h>
// #include "thread_pool_v0.hpp"
// #include "thread_pool_v1.hpp"
#include "thread_pool_v2.hpp"
#include "task.hpp"

const std::string ops = "+-*/%";

int main()
{
    srand(time(0) ^ getpid());
    // std::unique_ptr<thread_pool<task>> tp(new thread_pool<task>());
    thread_pool<task>* tp = thread_pool<task>::get_instance();

    while (true)
    {
        int x = rand() % 10;
        int y = rand() % 10; 
        char op = ops[rand() % ops.size()];

        task t(x, y, op);
        t.print_expression();
        tp->push(t);
    }

    return 0;
}
